import { createRouter, createWebHashHistory } from 'vue-router'

import Layout from '@/views/Layout.vue'
import Home from '@/views/home/index.vue'

const routes = [
  {
    path: '/',
    component: Layout,
    children: [
      { path: '/', component: Home },
      {path:'category/:id',component:()=> import('@/views/category/index.vue')},
      {path:'category/sub/:id',component:()=> import('@/views/category/sub.vue')},
    ]
  }
]

const router = createRouter({
  // 哈希路由
  history: createWebHashHistory(),
  routes
})

export default router
